package com.leyou.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author HeGuanChao
 * @Description TODO
 * @Date 2020/4/9 15:20
 */
@Controller
public class HelloController {

    @GetMapping("/hello")
    public String hello(Model model) {
        /*ModelAndView view = new ModelAndView();
        view.addObject("msg", "我是HelloController,我返回了msg信息");
        view.setViewName("hello");
        return view;*/
        model.addAttribute("msg", "我是HelloController,我返回了msg信息");
        return "hello";

    }
}
